﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace PS.Config.Utils
{
    public static class ReflectionHelper
    {
        public static IEnumerable<KeyValuePair<string, PropertyInfo>> EnumFields(object obj)
        {
            var type = obj.GetType();
            var fields = type.GetProperties(BindingFlags.Instance | BindingFlags.Public);
            return fields.Select(f => new KeyValuePair<string, PropertyInfo>(type.FullName + "_" + f.Name, f)).ToArray();
        }
    }
}
